<%@page import="com.util.Config"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
	<base href="<%= basePath %>">
	<%= Config.htmlMeta %>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script type="text/javascript" src="js/luck/luck.js"></script>
    <link rel="stylesheet" href="js/luck/skin/default/luck.css">
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/pintuer.js"></script>
    <script type="text/javascript" src="js/respond.js"></script>
    <script type="text/javascript" src="js/admin.js"></script>
    <script type="text/javascript" src="js/js.js"></script>
    <link type="image/x-icon" href="/favicon.ico" rel="shortcut icon" />
    <link href="/favicon.ico" rel="bookmark icon" />
    <script src="js/scwj/uploadPreview.js" type="text/javascript"></script>
    <script type="text/javascript" src="js/AutoEmail.js"></script>
    <style type="text/css">
    	.ben a:hover{color:#CC3300;text-decoration:underline;}
    	#myemail,.newemail,.newemailtitle{cursor:default;line-height:20px;}
    	.a-upload {
		    padding: 4px 10px;
		    height: 32px;
		    width: 150px;
		    text-align: center;
		    line-height: 20px;
		    position: relative;
		    cursor: pointer;
		    color: #888;
		    background: #fafafa;
		    border: 1px solid #ddd;
		    border-radius: 4px;
		    overflow: hidden;
		    display: inline-block;
		    *display: inline;
		    *zoom: 1
		}
		
		.a-upload  input {
		    position: absolute;
		    font-size: 100px;
		    right: 0;
		    top: 0;
		    opacity: 0;
		    filter: alpha(opacity=0);
		    cursor: pointer
		}
		
		.a-upload:hover {
		    color: #444;
		    background: #eee;
		    border-color: #ccc;
		    text-decoration: none
		}
    </style>
    <script type="text/javascript">
	    window.onload = function () {
            new uploadPreview({ UpBtn: "yhtx", DivShow: "imgdiv", ImgShow: "imgShow" });
        };
	    function zcxyh(){
	    	if(checkForm()){
	    		document.getElementById("form1").submit();
	    	}
	    }
	    function checkForm(){
	    	if(document.getElementById("name").value == ""){
	    		luckA('200px', '用户姓名不能为空', 5);
	    		return false;
	    	} else if(document.getElementById("password").value == ""){
	    		luckA('200px', '密码不能为空', 5);
	    		return false;
	    	} else if(document.getElementById("ok_pass").value == ""){
	    		luckA('200px', '确认密码不能为空', 5);
	    		return false;
	    	} else if(document.getElementById("ok_pass").value != document.getElementById("password").value){
	    		luckA('200px', '两次密码输入不一致', 5);
	    		return false;
	    	} else if(document.getElementById("sfzh").value == ""){
	    		luckA('200px', '身份证号不能为空', 5);
	    		return false;
	    	} else if(document.getElementById("sjhm").value == ""){
	    		luckA('200px', '手机号码不能为空', 5);
	    		return false;
	    	} else if(!/^(13[0-9]|14[0-9]|15[0-9]|18[0-9])\d{8}$/i.test(document.getElementById("sjhm").value)){
	    		luckA('200px', '手机号码格式不正确', 5);
	    		return false;
	    	} else if(document.getElementById("email").value == ""){
	    		luckA('200px', '邮箱不能为空', 5);
	    		return false;
	    	} else if(document.getElementById("passcode").value == ""){
	    		luckA('200px', '验证码不能为空', 5);
	    		return false;
	    	} else {
	    		return true;
	    	}
	    }
    </script>
</head> 
<body>
<div class="container">
    <div class="line">
        <div class="xs6 xm4 xs3-move xm4-move">
            <br /><br />
            <div class="media media-y">
                <a href="#"><img src="images/logo.png" class="radius"/></a>
            </div>
            <br /><br />
            <form action="user/zcxyh.action" id="form1" name="form1" method="post" enctype="multipart/form-data">
	            <div class="panel" style="width: 450px">
	                <div class="panel-head"><strong>注册新用户</strong></div>
	                <div class="panel-body" style="padding:30px;">
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" onkeydown="if(event.keyCode==13) $('#password').focus();" name="name" id="name" placeholder="用户姓名" data-validate="required:请填写用户姓名" />
	                            <span class="icon icon-user"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="password" class="input" onkeydown="if(event.keyCode==13) $('#ok_pass').focus();" name="password" id="password" placeholder="设置密码" data-validate="required:请设置密码" />
	                            <span class="icon icon-key"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="password" class="input" name="ok_pass" onkeydown="if(event.keyCode==13) $('#sfzh').focus();" id="ok_pass" placeholder="确认密码" data-validate="required:请填写确认密码" />
	                            <span class="icon icon-key"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" maxlength="18" onkeydown="if(event.keyCode==13) $('#email').focus();" class="input" name="sfzh" id="sfzh" placeholder="身份证号" data-validate="required:请填写身份证号" />
	                            <span class="icon icon-user-md"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" onkeydown="if(event.keyCode==13) $('#sjhm').focus();" name="email" id="email" placeholder="邮箱" data-validate="required:请填写邮箱"/>
	                            <span class="icon icon-envelope"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" onkeydown="chknum(this);" maxlength="11" name="sjhm" id="sjhm" placeholder="手机号码" data-validate="required:手机号码" />
	                            <span class="icon icon-phone"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right">
	                            <input type="text" class="input" name="qq" onkeydown="chknum(this);" maxlength="11" id="qq" placeholder="QQ帐号"/>
	                            <span class="icon icon-qq"></span>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field field-icon-right" id="imgdiv">
								<img alt="" width="170px" id="imgShow" style="border-radius: 10px;" height="150px" src="images/yhtx_default.jpeg">&nbsp;&nbsp;&nbsp;
								<a href="javascript:;" class="a-upload">
								    <input type="file" name="yhtx" id="yhtx" accept="image/jpeg,image/png">点击上传头像
								</a>
	                        </div>
	                    </div>
	                    <div style="margin-top: 5px"></div>
	                    <div class="form-group">
	                        <div class="field">
	                            <input type="text" onkeydown="chknum(this);" onblur="chkPasscode(this);" class="input" maxlength="4" name="passcode" id="passcode" placeholder="填写右侧的验证码" />
	                            <img style="cursor:pointer;" onclick="javascript:refresh(this);" src="./code3.jsp" id="code_img" title="点击更换" align="AbsMiddle" width="80" height="32" class="passcode" />
	                        </div>
	                    </div>
	                    <div class="form-group">
	                    	<div class="field" align="right">
	                    		&nbsp;<a href="#" onclick="fhdl();" style="text-decoration:none;font-size: 11px;">返回登录</a> 
								&nbsp;<a href="#" onclick="yjfk();" style="text-decoration:none;font-size: 11px;">意见反馈</a>
	                    	</div>
	                    </div>
	                </div>
	                <div class="panel-foot text-center" style="margin-top: -15px;">
	                	<button id="LoginButton" type="button" onclick="zcxyh()" class="button button-block bg-main">注册</button>
	                </div>
	            </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
